'use strict';
// 用来处理socket.io 来回的消息体
module.exports = (app) => {
  return async (ctx, next) => {
    const { app, socket, logger } = ctx;
    const onlineUsers = app.config.onlineUsers;

    socket.on("res", function (data) {
      // 添加成功后，广播消息
      socket.broadcast.emit("res", data);
    });

    await next();
  };
};
